using ContactCenter.Core.ObjectModel;
using NHibernate.Cfg;
using NHibernate.Event;

namespace ContactCenter.AuditEventListener
{
    public class AuditListenerTask : IConfigurationTask<Configuration>
    {
        public bool CanConfigure()
        {
            return true;
        }

        public Configuration Configure(Configuration configuration)
        {
            configuration.SetListener(ListenerType.PostUpdate, new AuditPostUpdateEventListener());
            configuration.SetListener(ListenerType.PostCollectionUpdate, new AuditPostCollectionUpdateEventListener());
            
            return configuration;
        }

        public int Position
        {
            get { return 100; }
        } 
    }
}
